<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="utf-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg" %>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>人力资源基础资料</title>
    <link href="<%=path%>/CSS/style.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" src="<%=path%>/JQuery/jquery-1.8.2.js"></script>
    <%@ include file="/WEB-INF/JSP/ajax.jsp" %>
    <script type="text/javascript" src="<%=path%>/My97DatePicker/WdatePicker.js"></script>
    <style type="text/css">
        .seachform li label {
            line-height: 45px;
            color: #444444
        }

        .scinput {
            line-height: 10px;
            margin-top: 5px
        }

        .scinput1 {
            margin-top: 5px;
            height: 30px;
        }

        .scbtn {
            background: #57a0ff;
            border-radius: 20px;
            width: 110px;
            margin-top: 4px;
            height: 35px
        }

        .scbtn2 {
            height: 20px;
            background: #57a0ff;
            border-radius: 20px;
            width: 50px;
            color: #fff;
            display: none;
        }

        .tablelist {
            border: none;
            margin: 10px 20px
        }

        .tablelist th {
            background: none;
            border-bottom: none;
        }

        thead {
            background: #f2f2f2
        }

        tbody tr:nth-child(even) {
            background: #f7f8fd
        }

        .tablelist th {
            height: 45px;
            padding-left: 30px
        }

        .tablelist td {
            border-right: none;
            padding-left: 30px
        }

        tbody tr {
            height: 38px
        }

        .check {
           
            padding-left: 0px
        }

        a {
            cursor: pointer;
        }
        .tablelist tr td{border-bottom:1px solid #BBB;}
    </style>
</head>
<body style="background: #f5f5f5;padding: 0 10px;">
<div class="place" style="background: #f5f5f5;margin-top: 10px">
    <ul class="placeul">
        <li><a href="#">基础资料</a></li>
        <li><a href="#">人力资源基础资料</a></li>
        <li><a href="<%=path%>/DrivingSys/selectRemuneration.html/look.action">薪酬项目</a></li>
    </ul>
</div>
	
	<div class="rightinfo" style="background: #fff;border-radius:10px;height: 45px;">

			<form action="<%=path%>/DrivingSys/selectRemunerationByFnameL2.html" method="post">
				<ul class="seachform">
					    <li><label>名称</label><input name="fnameL2" type="text" class="scinput" value="${fnameL2}"/></li>
					   <%--  <li><label>开始时间</label><input class="scinput1"  name="beginTime" type="text" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'datemax\')||\'%y-%M-%d\'}',dateFmt:'yyyy-MM-dd HH:mm:ss'})" 
					    id="datemin" class="input-text Wdate" style="width:150px;" value="${beginTime}"></li>
						<li><label>结束时间</label><input class="scinput1"  name="endTime" type="text" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'datemin\')}',maxDate:'%y-%M-%d',dateFmt:'yyyy-MM-dd HH:mm:ss'})" 
						id="datemax" class="input-text Wdate" style="width:150px;"value="${endTime}"></li> --%>		
						<li><label>&nbsp;</label><input name="" type="submit"  class="scbtn" value="立即查询" /></li>
                       <%-- <li><label>&nbsp;</label><input name="" type="button" id="importExcel" class="scbtn" value="导出Excel"></li>--%>
				</ul>
			</form>
		</div>



<div style="width: 100%;overflow:auto;margin-bottom: 0px;margin-top: 30px;background: #fff;border-radius:10px;box-shadow: 0 0 10px #f2f2f2;">
    <ul>
        <li style="height: 40px;text-align: left;color: #999999;">
				  <span style="font-size: 12px;">
                    <shiro:hasPermission name="/intoAddRemuneration.html">
				  <img alt="" style="margin-top: 20px;margin-left: 22px;height: 12px;"
                       src="<%=path%>/images/list/xz.png">
				       &nbsp;<a href="<%=path%>/DrivingSys/intoAddRemuneration.html">新增</a>
                    </shiro:hasPermission>
                       <shiro:hasPermission name="/deleteRemunerationByFid.html">
				  <img alt="" style="margin-top: 20px;margin-left: 22px;height: 12px;"
                       src="<%=path%>/images/list/sc.png">
				       &nbsp;<a class="del">删除</a>
                       </shiro:hasPermission>
                       <shiro:hasPermission name="/intoUpdateRemuneration.html">
                  <img alt="" height="11px" src="<%=path%>/images/list/xg.png" style="padding-left: 20px">
                        <a style="color: #000" class="modify">修改</a>
                       </shiro:hasPermission>
                      <shiro:hasPermission name="/importExcelRemuneration.html">
                          <img alt="" style="margin-top: 20px;margin-left: 22px;height: 12px;width: 14px" src="<%=path%>/images/list/excel.png">
                          &nbsp;<a class="importExcel">导出Excle</a>
                      </shiro:hasPermission>

				       <label style="padding-left: 50px">&nbsp;</label><input name="" type="submit" class="scbtn2"
                                                                              value="确定"/>
				  </span>
        </li>
    </ul>
    <table class="tablelist" style="width: auto;white-space:nowrap;">
        <thead>
        <tr class="sq">
            <th class="sq"><input type="checkbox"  class="check1"  /></th>
            <th>编码</th>
            <th>名称</th>
            <th>简称</th>
            <th>描述</th>
            <th>创建时间</th>
            <th>最后修改时间</th>
            <th>创建者</th>
            <th>修改人</th> 
            <th>状态</th>  
            <th>类型</th> 
            <th>金额</th>     
            <th>操作</th>
        </tr>
        </thead>
        <c:if test="${empty remunerationList  }">
        	<tr class="sq">
        		<th colspan="13">
        			<span >抱歉,没有任何相关的记录信息!</span>
        		</th>
        	</tr>
        </c:if>
        <c:forEach items="${remunerationList}" var="remuneration" varStatus="s">
            <tr>
                <td><input name="check" class="check" type="checkbox"  value="${remuneration.fid}"/></td>
                <td>${remuneration.fnumber}</td>
                <td>${remuneration.fnameL2}</td>
                <td>${remuneration.fsimplename}</td>
                <td>${remuneration.fdescriptionL2}</td>
                <td>${remuneration.fcreatetime}</td>
                <td>${remuneration.flastupdatetime}</td>
                <td>${remuneration.createName}</td>
                <td>${remuneration.updateName}</td>
                <c:if test="${remuneration.cfstate eq 1}">
					<td>启动</td>
				</c:if><c:if test="${remuneration.cfstate eq 2}">
					<td>禁用</td>
				</c:if>
				<c:if test="${remuneration.cffixation eq 1}">
					<td>固定</td>
				</c:if>
				<c:if test="${remuneration.cffixation eq 2}">
					<td>可变</td>
				</c:if>
				<c:if test="${remuneration.cffixation eq 3}">
					<td>手录</td>
				</c:if>
				<c:if test="${remuneration.cffixation eq 4}">
					<td>内置</td>
				</c:if>
                <td>${remuneration.cfamount}</td>
                <td>
                    <shiro:hasPermission name="/intoUpdateRemuneration.html">
                    <img alt="" height="11px" src="<%=path%>/images/list/xg.png">
                    <a href="<%=path%>/DrivingSys/intoUpdateRemuneration.html?fid=${remuneration.fid}" class="tablelink">修改</a>&nbsp;&nbsp;&nbsp;
                    </shiro:hasPermission>
                    <shiro:hasPermission name="/deleteRemunerationByFid.html">
                    <img alt="" style="margin-top: 20px;margin-left: 22px;height: 12px;" src="<%=path%>/images/list/sc.png">
				       &nbsp;<a class="delOne" class="tablelink" style="color: #056dae">删除<input type="hidden" value="${remuneration.fid}"></a>
						&nbsp;&nbsp;&nbsp;
                    </shiro:hasPermission>
                </td>
            </tr>
        </c:forEach>
    </table>
</div>
<pg:pager items="${pb.tr}" url="${pb.url}" export="offset,currentPageNumber=pageNumber" maxPageItems="${pb.ps}">
            <pg:index>  
               <pg:first>
               <a href="${pageUrl}&&type=${type}" >
               <nobr>
               [首页]
               </nobr>
              </a>   
               </pg:first>  
               <pg:prev><a href="${pageUrl}&&type=${type}">前一页</a></pg:prev>  
               <pg:pages>  
                     <c:choose>  
                        <c:when test="${currentPageNumber eq pageNumber}">    
                           <font color="red">${pageNumber }</font>  
                        </c:when>    
                        <c:otherwise>    
                           <a href="${pageUrl}&&type=${type}">${pageNumber}</a>   
                        </c:otherwise>    
                     </c:choose>  
               </pg:pages>  
               <pg:next><a href="${pageUrl}&&type=${type}">下一页</a></pg:next>  
               <pg:last><a href="${pageUrl}&&type=${type}"><nobr>[尾页]</nobr></a></pg:last>  
            </pg:index>      
         </pg:pager>
<div class="tip">
    <div class="tiptop">
        <span>提示信息</span>
    </div>
    <div class="tipinfo">
        <span><img src="<%=path%>/images/ticon.png"/></span>
        <div class="tipright">
            <p>是否确认对信息删除 ？</p>
            <cite>如果是请点击确定按钮 ，否则请点取消。</cite>
        </div>
    </div>
    <div class="tipbtn">
        <input name="" type="button" class="sure" value="确定"/>&nbsp; <input
            name="" type="button" class="cancel" value="取消"/>
    </div>
</div>
</body>
<script type="text/javascript">
    $(document).ready(function () {
        var type = "${type}";
        if (type == "1") {
            //alert("添加成功!");
            editAlert();
        }
    })
    $(document).ready(function () {
    	$('.del').click(function () {           
        	var fidids = document.getElementsByName("check");
			var remunerationid; 
			for( var i = 0; i < fidids.length; i++){
				if (fidids[i].checked){
					remunerationid = fidids[i].value;
				}
			}
			if(remunerationid == null || remunerationid == ""){
				alert("请至少选择一条数据删除")
				return false
			}else{
				$(".tip").fadeIn(200);
			}
			$(".sure").click(function(){
				  $(".tip").fadeOut(100);				 
				  var str = new Array(); 
				  var fids = document.getElementsByName("check");
					  for( var i = 0; i < fids.length; i++ ){
						  if (fids[i].checked){
							  str[i] = fids[i].value;
					  	   }
					  }
					location='<%=path%>/DrivingSys/deleteRemunerationByFid.html?deleteId='+str+'';
				  })
				  
				  $(".cancel").click(function(){
					  $(".tip").fadeOut(100);
					});
        })
        //删除单个
		$('.delOne').click(function(){
			var fid = $(this).find("input:hidden").val();
                $('.window-mask').fadeToggle()
				$(".tip").fadeIn(200);
				$(".sure").click(function(){
					location='<%=path%>/DrivingSys/deleteRemunerationByFid.html?fid='+fid+'';
				})
				
				 $(".cancel").click(function(){
					  $(".tip").fadeOut(100);
				});
 			})
 			
       /*  $('.scbtn2').click(function () {
            $(".tip").fadeIn(200);
            $(".sure").click(function () {
                $(".tip").fadeOut(100);
                $('.check').toggle()
                $('.scbtn2').toggle()
                /* location='deleteCarByFid?deleteId='+deleteId+''; 
                var str = new Array();
                var fids = document.getElementsByName("check");
                for (var i = 0; i < fids.length; i++) {
                    if (fids[i].checked) {
                        str[i] = fids[i].value;
                    }
                }
                if (str == null || str == '') {
                    alert("至少勾选一条数据删除")
                    return false
                } else {
                    location = 'deleteremunerationascByFid.html?deleteId=' + str + '';
                }
            })

            $(".cancel").click(function () {
                $(".tip").fadeOut(100);
            });
        }) */
        //修改
        $(".modify").click(function () {
            var stringFid;
            var fids = document.getElementsByName("check");
            var schools
            for (var i = 0; i < fids.length; i++) {
                if (fids[i].checked) {
                    stringFid = fids[i].value;
                    location = '<%=path%>/DrivingSys/intoUpdateRemuneration.html?fid=' + stringFid + '';
                    return false
                }
            }
            if (stringFid == null || stringFid.length == 0) {
                alert("请至少选择一条数据修改")
                return false
            }
        })
        //查询详情
        $("tr:not(.sq)").dblclick(function () {
            var modify = $(".modify").text();
            if(modify == '' || modify == null){

            }else{
                var fid2 = $(this).find(".check").val();
                //避免fid中有+，或者特殊字符
                var fid = encodeURI(fid2).replace(/\+/g, '%2B')
                location = '<%=path%>/DrivingSys/intoUpdateRemuneration.html?fid=' + fid + '';
            }
        })
		//全选全不选
		$(".check1").click(function(){
			if(this.checked){
			    $("[name=check]").attr("checked",true);}
			else{ $("[name=check]").attr("checked",false);}
		})
    })
    //导出
    $(".importExcel").click(function () {
        var fnameL2 = $("input[name='fnameL2']").val();//名称
        fnameL2 = $.trim(fnameL2);
        location = '<%=path%>/DrivingSys/importRemuneration?fnameL2=' + fnameL2
    })
</script>
</html>